home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 5 / chrpro3.zip / MCONINIT.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  3KB  |  95 lines

  1. * Program MCONINIT - Initializes the CONTRIB file for a new month
  2. ERASE
  3. If wknummax=15
  4.   Store 'Quarter' to XPER
  5. else
  6.   Store 'Month  ' to XPER
  7. endif
  8. @ 2,20 say 'CONTRIBUTIONS FILE INITIALIZE ROUTINE'
  9. @ 5,6 SAY  'The following steps are about to be performed -'
  10. @ 7,8 say  '1. Entry of the dates of the Sundays of the up-coming '+XPER
  11. @ 8,8 say  '2. Renaming the CONTRIBX file to be called CONTRIB for continuing'
  12. If CSA<>' '
  13. @ 9,8 say '3. Renaming the CDIRFILX file to be called CDIRFILE (Special Funds)'
  14. endif
  15. ?
  16. Accept '      Ok? ' to XX
  17. If !(XX)<>'Y'
  18.   Return
  19. endif
  20. STORE D+':CONTRIBX.DBF' TO NFILE
  21. Store T to invalid
  22. Select secondary
  23. Use CDIRFILE index CDIRFILE
  24. GOTO 4
  25. Store $(spact,3,29) to newmo1
  26. If wknummax=15
  27.   SKIP
  28.   Store $(spact,3,29) to newmo2
  29.   SKIP
  30.   Store $(spact,3,29) to newmo3
  31. endif
  32. Do while invalid
  33.   @ 14,0
  34.   @ 15,0 say '        Enter the dates of the Sundays of next '+XPER
  35.   @ 16,0
  36.   @ 17,10 say 'MO/W1 MO/W2 MO/W3 MO/W4 MO/W5'
  37.   @ 18,9 get newmo1
  38.   If wknummax=15
  39.     @ 19,10 say 'MO/W1 MO/W2 MO/W3 MO/W4 MO/W5'
  40.     @ 20,9 get newmo2
  41.     @ 21,10 SAY 'MO/W1 MO/W2 MO/W3 MO/W4 MO/W5'
  42.     @ 22,9 get newmo3
  43.   endif
  44.   READ
  45.   ?
  46.   Accept '         Ok? ' to XX
  47.   If !(XX)='Q'
  48.     USE
  49.     RETURN
  50.   endif
  51.   If !(XX)='Y'
  52.     goto 4
  53.     Store F to invalid
  54.     replace spact with $(spact,1,2)+newmo1
  55.     If wknummax=15
  56.       SKIP
  57.       replace spact with $(spact,1,2)+newmo2
  58.       SKIP
  59.       replace spact with $(spact,1,2)+newmo3
  60.     endif
  61.   endif
  62. enddo
  63. USE
  64. Select primary
  65. Accept 'Now about to rename the CONTRIBX file to be CONTRIB. Ok? ' to XX
  66. If !(XX)='Y'
  67.  Store d+':CONTRIB.DBF' to MFILE
  68.  IF FILE(NFILE)
  69.   If file(MFILE)
  70.     Delete file &MFILE
  71.   endif
  72.   Rename &NFILE to &MFILE
  73.   Accept ;
  74. "The CONTRIB file is now set up for next period's entries. Press <retn>" to XX
  75.  ELSE
  76.   ? 'File CONTRIBX does not exist. It has either not been created yet or has'
  77.   Accept 'already been renamed to CONTRIB. Press <retn> to exit ' to XX
  78.  endif
  79. endif
  80. Accept 'Now about to rename the CDIRFILX to be CDIRFILE (Special Funds) OK? ' ;
  81.  to xx
  82. If !(XX)='Y'
  83.  If file(CDIRFILX)
  84.   If file(CDIRFILE)
  85.     delete file cdirfile
  86.   endif
  87.   rename cdirfilx to cdirfile
  88.   rename cdirfilx.ndx to cdirfile.ndx
  89.  else
  90.   Accept 'CDIRFILX file not found on the PROGRAM disk. Press <RETURN> ' to xx
  91.  endif
  92. endif
  93. Release XPER,newmo1,newmo2,newmo3,XFILE
  94. RETURN
  95.  Y           Z          !0          !1          !2          !3          !4           !5